package com.immunology.servlets;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class UserServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;

	public UserServlet() {

	}

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		PrintWriter out = response.getWriter();
		out.println("User page");
		/*
		 * User userFromSession = (User) request.getSession().getAttribute(
		 * AttributeContent.USER); UserService userService = new UserService();
		 * if (userFromSession != null) { String strId =
		 * request.getParameter("id"); int id = Integer.parseInt(strId); User
		 * user = userService.getUserById(id); GetUserInterestsService
		 * interestsService = new GetUserInterestsService(); List<Interest>
		 * interests = interestsService.getInterestUser(user); List<User>
		 * friends = new FriendService().getFriendsByUserId(user.getId());
		 * List<Comment> comments = new
		 * CommentService().getCommentsByUserId(id);
		 * request.setAttribute("interests", interests);
		 * request.setAttribute("friends", friends);
		 * request.setAttribute("user", user);
		 * request.setAttribute("userFromSession", userFromSession);
		 * request.setAttribute("comments", comments); boolean isFriend =
		 * userService.isFriend(userFromSession.getId(), user.getId());
		 * request.setAttribute("isFriend", isFriend);
		 * getServletContext().getRequestDispatcher("/index.jsp").forward(
		 * request, response); }else{ response.sendRedirect(""); }
		 */
	}

}